﻿
namespace LS.Nc6.Application.System
{
    /// <summary>
    /// 提供功能项管理服务
    /// </summary>

    public class SysFunctionService : BaseService<SysFunctionEntity>, ISysFunctionService, ITransient
    {
        #region 实现接口方法
        public async Task<bool> ExistsFunCode(string id, string funCode)
        {
            return await DbContext.Instance.Queryable<SysFunctionEntity>().WhereIF(!string.IsNullOrEmpty(id) && id.ParseToInt()>0, it => it.Id != id.ParseToLong())
               .WhereIF(!string.IsNullOrEmpty(funCode), it => it.FunCode == funCode).CountAsync() > 0;
        }

        #endregion 实现接口方法


    }
}
